package org.dstart.object.menulist.struct
{
	public class ClassStruct
	{
		public var className:String	= "";			/** 类别名称  **/
		public var classDisplay:String = "";		/** 用于显示出来的名称 **/
		public var subArray:Array	= new Array();	/** 子类列表(一个 ClassStruct 数组 **/
		public var data:Object;						/** 数据项 **/
		
		public function ClassStruct(str:String, showStr:String = "", obj:* = null)
		{
			className = str;
			classDisplay = (showStr.length > 0) ? showStr : className;
			data = obj;
		}
		
		public function CheckIn(str:String, isTotal:Boolean = true):Boolean
		{
			if(isTotal)
			{
				if(className == str)
				{
					return true;
				}
			}
			else
			{
				subArray.sort();
				for(var i:int = 0; i < subArray.length; i++)
				{
					var tData:ClassStruct = subArray[i];
					if(tData.CheckIn(str))
					{
						return true;
					}
				}
			}
			
			return false;
		}
		
		public function toString():String
		{
			return "className:" + className + "subArray:" + subArray.join("::");
		}
	}
}